package com.log320.huffman;

import java.util.Comparator;
/**
 * Simple comparator that compares two binary code by their characters ascii order.
 *
 */
public class BinaryCodeAlphabeticalComparator implements Comparator<BinaryCode>{

	@Override
	public int compare(BinaryCode bin1, BinaryCode bin2) {
		int value;
		if(bin1.getCharacter()<bin2.getCharacter()){
			value=-1;
		}else{
			value=1;
		}
		
		return value;
	}
	
}
